<@bootstrap.head />
<@bootstrap.body>
	<div class="content">
			<!-- 注册节点OS信息 -->
			<table id="OSTable" url=""  class="">																	
				<thead>																																									
					<tr role="row">																																					
						<th class="ui-state-default" role="columnheader" colspan="3" style="" >Os Typs List</th> 										
					</tr>
					<tr role="row">																																					
						<th class="ui-state-default" role="columnheader"  style="" >systemname</th> 										
						<th class="ui-state-default" role="columnheader"  style="" >release</th> 
						<th class="ui-state-default" role="columnheader"  style="" >bits</th> 																				
					</tr>																																											
				</thead>																																								
				<tbody id="os-tbody" role="alert" aria-live="polite" aria-relevant="all">																										
				</tbody>																																								
			</table>
			<br>
			<!-- 注册节点主机信息 -->
			<table id="OSTable" url=""  class="">																	
				<thead>																																									
					<tr role="row">																																					
						<th class="ui-state-default" role="columnheader" colspan="6" style="" >Hosts List</th> 										
					</tr>
					<tr role="row">																																					
						<th class="ui-state-default" role="columnheader"  style="" >systemname</th> 										
						<th class="ui-state-default" role="columnheader"  style="" >release</th> 
						<th class="ui-state-default" role="columnheader"  style="" >bits</th> 	
						<th class="ui-state-default" role="columnheader"  style="" >ip</th> 										
						<th class="ui-state-default" role="columnheader"  style="" >idler_count</th> 
						<th class="ui-state-default" role="columnheader"  style="" >working_count</th> 																										
					</tr>																																											
				</thead>																																								
				<tbody id="hosts-tbody" role="alert" aria-live="polite" aria-relevant="all">																										
				</tbody>																																								
			</table>			
			<br>
			<!-- 计算节点进程信息 -->
			<table id="OSTable" url=""  class="">																	
				<thead>																																									
					<tr role="row">																																					
						<th class="ui-state-default" role="columnheader" colspan="7" style="" >Workers List</th> 										
					</tr>
					<tr role="row">																																					
						<th class="ui-state-default" role="columnheader"  style="" >systemname</th> 										
						<th class="ui-state-default" role="columnheader"  style="" >release</th> 
						<th class="ui-state-default" role="columnheader"  style="" >bits</th> 	
						<th class="ui-state-default" role="columnheader"  style="" >ip</th> 										
						<th class="ui-state-default" role="columnheader"  style="" >port</th> 
						<th class="ui-state-default" role="columnheader"  style="" >is_working</th> 
						<th class="ui-state-default" role="columnheader"  style="" >program_and_params</th> 																										
					</tr>																																											
				</thead>																																								
				<tbody id="workers-tbody" role="alert" aria-live="polite" aria-relevant="all">																										
				</tbody>																																								
			</table>				
	</div>
</@bootstrap.body>

<script>
		
		  var Tab = {} ;
		  
		  //Os Types List Tr
		  Tab.OsTr = '<@compress  single_line=true>
			  				<tr>
								<td>%{systemName}</td>
								<td>%{release}</td>
								<td>%{bits}</td>
							</tr>
					</@compress>';
		  //Hosts List Tr			
		  Tab.HostTr = '<@compress  single_line=true>
			  				<tr>
								<td>%{systemName}</td>
								<td>%{release}</td>
								<td>%{bits}</td>
								<td>%{ip}</td>
								<td>%{idlerCount}</td>
								<td>%{workingCount}</td>						
							</tr>
						</@compress >' ;
		  
		  //Workers List Tr
		  Tab.WorkerTr = '<@compress  single_line=true>
			  				<tr>
								<td>%{systemName}</td>
								<td>%{release}</td>
								<td>%{bits}</td>
								<td>%{ip}</td>
								<td>%{port}</td>
								<td>%{isWorking}</td>
								<td>%{programAndParams}</td>
							</tr>
						</@compress >' ;			
		
		
		getIbmsInfo();
		
		//获取注册中心信息
		function getIbmsInfo(){
			getOsTypesList();
			getHostsList();
			getWorkersList();
		}
		
		//获取注册中心OS信息
		function getOsTypesList(){
			$.ajax({
				url:"<@spring.url "/registerNode/getOsTypesList" />",
				data:{},
				type:"post",
				success:function(text){
					if(text.success){
					  var data = text.data ;
					  var html = "" ;
					  for(var i=0;i<data.length;i++){
					     html += C._template(Tab.OsTr,data[i]);
					  }
					  $("#os-tbody").html(html);
					}
				}
			});
		}
		
		
		//获取注册中心主机信息
		function getHostsList(){
			$.ajax({
				url:"<@spring.url "/registerNode/getHostsList" />",
				data:{},
				type:"post",
				success:function(text){
					if(text.success){
					  var data = text.data ;
					  var html = "" ;
					  for(var i=0;i<data.length;i++){
					     html += C._template(Tab.HostTr,data[i])
					  }
					  $("#hosts-tbody").html(html);
					}		
				}
			});
		}
		
		//获取计算节点进程信息
		function getWorkersList(){
			$.ajax({
				url:"<@spring.url "/registerNode/getWorkersList" />",
				data:{},
				type:"post",
				success:function(text){
					if(text.success){
					  var data = text.data ;
					  var html = "" ;
					  for(var i=0;i<data.length;i++){
					     html += C._template(Tab.WorkerTr,data[i])
					  }
					  $("#workers-tbody").html(html);
					}		
				}
			});
		}

</script>